<?php PageUtil::addVar("stylesheet","<link href=\"".$stylepath."/forum.css\" rel=\"stylesheet\">");?>
<div class="left_content">
  <div class="forum_box">
      <div>
        <h2><img src="<?php echo $imagepath;?>/topic_icon.png"> <?php echo $forum[0]["name"];?> <a class="btn btn-success pull-right" href="<?php echo base_url("forum/create/".$forum[0]["id"]); ?>"><i class="icon-pencil"></i> สร้างกระทู้ใหม่</a></h2>
        
      </div>
      <table class="table table-hover table-condensed">
        <thead>
          <tr>
            <th width="10%"></th>
            <th width="70%"></th>
            <th width="20%"></th>
          </tr>
        </thead>
        <tbody>
        <?php
          if(!empty($listpost)){
            foreach ($listpost as $key => $value) {
        ?>
          <tr>
            <td class="post-list-image">
              <?php
                if(!empty($value["images"])){
                ?>
                  <img src="<?php echo base_url($value["images"][0]["small"]);?>" width="60">
                <?php
                }else{
                  ?>
                  <img src="<?php echo $imagepath."/not_available-2.jpg";?>" width="60">
                  <?php
                }
              ?>
            </td>
            <td>
              <div class="post-list">
                <a href="<?php echo base_url('forum/view/'.$value["url"]);?>"><strong><?php echo $value["title"];?></strong></a>
                <div class="muted"><small><?php echo mb_substr(strip_tags($value["content"]), 0, 60,"UTF-8");?>...</small></div>
              </div>
            </td>
            <td class="category-list-detail">
              โดย <?php echo $value["firstname"];?><br />
              เมื่อ <?php echo Util::ezDate($value['cr_date']); ?>
            </td>
          </tr>
        <?php
            }
          }else{
            ?>
          <section class="alert_area">
              <section class="alert_detail">
                <p class="text-center">ยังไม่มีกระทู้</p>
              </section>
          </section>
        <?php
          }
        ?>
        </tbody>
    </table>
  </div>
  <div class="pagination text-center"><ul><?php echo $this->pagination->create_links();?></ul></div>
</div>